package com.bfl.sa.personal.calendar.converter;

import com.bfl.sa.personal.calendar.entity.Calendar;
import com.bfl.sa.personal.calendar.service.CalendarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.convert.converter.Converter;

public class CalendarConverter implements Converter<String, Calendar> {

    @Autowired
    private CalendarService calendarService;

    @Override
    public Calendar convert(String id) {
        return calendarService.findOne(Long.parseLong(id));
    }
}
